#ifndef CCOMPILER_H
#define CCOMPILER_H

#include <QString>
#include <QHash>

#include "../CFrame.h"

typedef void (*CAction)(CFrame&, QStack<CFrame*>&);

class CFunction
{
private:
    char* _code;
    int _codeSize;
    CAction _action; //native
    int _paramCount;
    QHash<QString, char*> _variables;
    QVector<QString>* _parameters;

public:
    CFunction(char* code, int codeSize, int paramCount, QHash<QString, char*> variables, QVector<QString>* parameters);
    CFunction(CAction action, int paramCount, QHash<QString, char*> variables, QVector<QString>* parameters);
    ~CFunction();

    char* code();
    int codeSize();
    CAction action();
    bool isNative();
    int paramCount();
    QHash<QString, char*>& variables();
    QVector<QString>& parameters();
};

#endif
